#include "server.h"

void resetPassword(char* buf)
{
	char path[PATH_LEN] = {};
	sprintf(path,"%s%s",ACC_PATH,ctos.acc.bank);

	int fd = open(path,O_WRONLY);
	if(0 > fd)
	{
		error("open");
		sprintf(buf,"N:服务器正在升级，查询失败!");
		return;
	}

	Acc acc = {};
	read(fd,&acc,sizeof(Acc));
	strcpy(acc.password,ctos.acc.password);
	write(fd,&acc,sizeof(Acc));
	
	sprintf(buf,"Y:修改密码成功!");
}
